package com.tianji.promotion.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.po.Coupon;
import com.tianji.promotion.domain.po.ExchangeCode;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.domain.vo.ExchangeCodeVO;

/**
 * <p>
 * 兑换码 服务类
 * </p>
 *
 * @author friday
 * @since 2024-01-14
 */
public interface IExchangeCodeService extends IService<ExchangeCode> {

    /**
     * 异步生成兑换码
     * @param coupon
     */
    void asyncGenerateExchangeCode(Coupon coupon);

    /**
     * 标记兑换码
     * @param serialNum
     * @param flag
     * @return
     */
    boolean updateExchangeCodeMark(long serialNum, boolean flag);

    /**
     * 分页查询兑换码
     * @param query
     * @return
     */
    PageDTO<ExchangeCodeVO> queryCodePage(CodeQuery query);
}
